<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title></title>
  <script type='text/javascript' src='js/vue-2.6.10.js'></script>
</head>

<body>
  <div id='app'>
    <base-layout>
      <template #header="{ user }">
        <h2>{{ user.firstName }} </h2>
      </template>

      <p>A paragraph for the main content.</p>
      <p>And another one.</p>

      <template #footer>
        <p>Here's some contact info</p>
      </template>
    </base-layout>
  </div>
  <script type='text/javascript'>
    Vue.component('base-layout', {
      data() {
        return {
          user: {
            firstName: 'Harry',
            lastName: 'Hao'
          }
        }
      },
      template: `
        <div class="container">
          <header>
            <slot name="header" :user="user">{{ user.lastName}}</slot>
          </header>
          <main>
            <slot></slot>
          </main>
          <footer>
            <slot name="footer"></slot>
          </footer>
        </div>
      `,
    })
    var vm = new Vue({
      el: '#app',
      data: {

      },
      methods: {

      }
    });
  </script>
</body>

</html>